<MDXHeader
  title="Text Field"
  description="A text input that allow users to input custom text entries with a keyboard."
  docs="https://kobalte.dev/docs/core/components/text-field"
/>

<ComponentPreview name="text-field-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add text-field
```

</TabsContent>

<TabsContent value="manual">

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="text-field" />

</TabsContent>

</Tabs>

## Usage

```tsx
import { TextField, TextFieldInput } from "~/components/ui/text-field"
```

```tsx
<TextField>
  <TextFieldInput />
</TextField>
```

## Examples

### Multiline

Use `TextFieldTextArea` instead of `TextFieldInput` to create a multiline text field.

<ComponentPreview name="text-field-textarea-demo" />

### Error as tooltip

<ComponentPreview name="text-field-error-demo" />
